<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<title>M3U8 Video Player</title>
	</head>
	<body>
		<video id="video" controls muted >
			Your browser does not support the video tag.
		</video>
		<script src="https://www.helloweba.net/demo/2018/hls/hls.js"></script>
		<script>
			var video = document.getElementById('video');
			if (Hls.isSupported()) {
				var hls = new Hls();
				// hls.loadSource('https://yunqivedio.alicdn.com/2017yq/v2/0x0/96d79d3f5400514a6883869399708e11/96d79d3f5400514a6883869399708e11.m3u8');
				hls.loadSource('http://10.21.221.1/hls/test.m3u8');
				hls.attachMedia(video);
				hls.on(Hls.Events.MANIFEST_PARSED, function() {
					video.play();
					setTimeout(() => {
						video.currentTime = duration;
					}, 2000)
				});
			}
		</script>
	</body>
</html>